home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Unix / ps2epsmac1.3.shar / README < prev    next >
Text File  |  1993-05-21  |  10KB  |  279 lines

  1.  
  2. ps2eps-mac takes an arbitrary postscript file
  3. ( even sort of works with macintosh laserwriter driver dumps.. )
  4. and creates an 'encapsulated postscript with embedded pict' file in
  5. macbinary format.
  6. This file can be included in certain programs ( eg Word5 ) that support
  7. the format, and you will get a 72dpi screen preview image, but postscript
  8. quality output on your postscript printer.
  9. Note that there is no way to represent multi page documents using 
  10. the embeded pict format.
  11.  
  12. so far it has been used sucessfully with
  13. MSWord 5 and its 'draw' module ( does _not_ work with MSW4 or lower )
  14. OzTeX
  15. Kalidagraph
  16. a short list, sigh -- anything else?
  17.  
  18. to make use of this program you need ghostscript and pbmplus
  19.  
  20. ..and you need to know how to transfer a macbinary file to your macintosh
  21.  in a nutshell -- set your unix transfer program to 'binary' and your
  22.  macintosh transfer program to 'macbinary'
  23.  
  24. quick and dirty usage is simply
  25. ps2eps-mac file.ps
  26. -which produces file.eps.bin
  27. -which when transferred to your mac will be named "file.eps"
  28. by default this will be a Word5 file, double clicking on this file will 
  29. open it in word5, with a nice screen image.
  30.  
  31. You can easily change the type/creator by setting shell variables
  32. so that the eps file will open in your favorite eps compatible program.
  33.  
  34. notes-----------
  35. usage 
  36.    ps2eps-mac [ options ] file.ps
  37. options can be any of..
  38.  -q -> quiet mode, overwrites scratch files without asking
  39.  -batch -> same as -q
  40.  -d -> where to put the output file, can be "stdout" to pipe output
  41.        to stdout ( automatically sets "-q" and sends errors to a log file )
  42.  -pipe, eqivalent to "-d stdout"
  43.  -log logfile -> send output messages to logfile
  44.  -debug n -> change debug level to n
  45.  -widen n or -widen unset -> override default widenbox value
  46.  
  47. environment variables
  48. setenv EPSTYPE EPSF
  49. setenv EPSCREATOR MSWD
  50. to set the type and creator of the macintosh file
  51. the defaults are EPSF,MSWD which let me double click
  52. to open the file in MSWord 5, the defaults are defined in ps-pict2macbin.c
  53.  
  54. be sure that the following are on your path, or are in the
  55.  $ps2epsdir directory list
  56.  
  57. ps-pict2macbin
  58. er_echo  <well, you could live without this..>
  59.  ( in the ps2eps-mac shell archive )
  60.  
  61. pnmcrop _or_ pnmcut  < pnmcut works better i think, get both if you can >
  62. pbmtoepsi                      
  63. ppmtopict                      
  64.  ( export.lcs.mit.edu ; contrib/pbm* )
  65.  
  66. gs                             
  67.  ( prep.ai.mit.edu ; pub/gnu/ghost* ) 
  68.  
  69. macps
  70.  ( sumex-aim.stanford.edu ; info-mac/unix )
  71.  macps is needed if the original ps file is a macintosh
  72.  laserwriter driver dump
  73.  
  74. acknowledgements  -- in addition to the above programs, I learned a lot
  75. ( and maybe borrowed some code.. ) from 
  76.  
  77. mcvert
  78. macbin
  79. ps2epsf  Doug Crabill may notice that this shell script bears some
  80.          resemblence to his script ( which creates a pc compatable file )
  81.  
  82. the man page was contributed by jc@msc.edu
  83.  
  84. known bugs
  85.  
  86. translating line endings with tr is bound to mess up any binary stuff
  87.  in the source postscript  -- try playing with the translate options
  88.  if someone knows a foolproof way to do line ending translation,
  89.  please give me a call...
  90.  
  91. explination of options that can be set in the ps2eps-mac script 
  92. { for csh novices...
  93.   a shell variable can be 'set'
  94.   set x
  95.   or set to a value
  96.   set x = 1
  97.   or set to a list
  98.   set x = ( 1 A 4.5 )
  99.   the line,
  100.   #set x
  101.   is commented out, thus ( unless previously set ) x is 'unset'
  102.  
  103.   in this program, all of the variables in the options section
  104.   may be 'set' or 'unset'.  Some of them - where indicated -
  105.   must be set to values, if they are set.      }
  106.  
  107. #set ps2epsdir =  ( /usr/new/bin )
  108.  
  109. add directories to your search path.
  110. you might need here the directorys containing 
  111. gs, pbm stuff, the ps-pict2macbin executable
  112.  
  113. line ending translation options -- a concern only if your ps contains
  114. very long lines or binary data ( included fonts and such )
  115.  
  116. #set notranslate
  117.  
  118. leave unix line endings everywhere
  119. notranslate _does_not_work_ with msword. -- does it work with anything???
  120.  
  121. #set notransfile
  122.  
  123. set notranslatefile to put mac line endings on only the first
  124. two lines of the file -- this is a little wierd but it seems
  125. to work.  I am really curious if this is ok with ps interpreters
  126. like freedom of the press.  This 'aint gonna work when the 
  127. existing bounding box is used ( see bbinfo below )
  128.  
  129. #set havemacps
  130.  
  131. uncomment only if you have macps and you might be processing
  132. a mac laserwriter driver generated file ( beware, you are on thin ice.. )
  133. typically your 'eps' file will only print from a mac running a certain
  134. laserwriter driver.
  135.  
  136. #set noshowpage
  137. uncomment to add line to undefine showpage in the postscript [/showpage {} def]
  138. only necessary if..
  139. 1)your ps contains showpage
  140. 2) your mac application doesn't like it ( eg Word )
  141. ..but it should never hurt.. ( yea right )
  142.  
  143. #set density = 72        
  144.  
  145. do not use this -- changing the density changes the _size_ not the
  146. resolution of the pict image , sigh.  If somone 'fixes' ppmtopict to
  147. have a resolution option me and my deskwriter will be greatful.
  148. ( value required, if set )
  149.  
  150. set widenbox = 1
  151.  
  152. the bounding box sometimes chops off edges of picture, this uses a hack to 
  153. widen the bb by $widenbox points 
  154. an error will result if the 'new' bounding box goes beyond the
  155. edge of ghostscripts 'page' -- if your ps draws at the origin then
  156. you cant widen the box ( try using a translate in the source ps )
  157. note -- set widenbox = 0 is not exactly the same as leaving widenbox unset
  158. -- pnmcut is used rather than pnmcrop ( in priciple the same result by a 
  159. different method )
  160. widenbox can now be defined on the command line as well ( see usage )
  161. whatever you do with it here is the default.
  162. ( value required, if set  *integer only* )
  163.  
  164. #set bbinfo
  165.  
  166. with bbinfo not set, use the bounding box in the original ps file
  167. ( if one exists ) -- requires widenbox to be set as well.
  168. bbinfo unset, and widenbox = 0
  169. leaves the postscript 'data fork' completely
  170. original if the original file contains a bounding box.  Of course, if
  171. the existing bounding box is wrong you will get garbage.
  172.  
  173. set widenboxbb = 0
  174.  
  175. if set, widenboxbb overrides widenbox in cases where existing 
  176. bounding box is used ( typically this should be zero I guess. )
  177. widenbox still must be set to something for this to happen.
  178. ie. the default operation is
  179. no bounding box in original file -> calculate a box and widen by 1 point
  180. bounding box in original file -> use it, no modification at all to postscript
  181. ( value required, if set )
  182.  
  183. please inform me, if you have problems with widenbox, as the pnmcrop
  184. method of cropping the pict will be left out of future versions
  185. if it is not needed.
  186.  
  187. set error = er_echo
  188.  
  189. error reporting program, in case the default er_echo does not compile,
  190. there is a csh script st_echo. st_echo does not work with -log or -pipe
  191. ( value required )
  192.  
  193. #set log ps2eps.log
  194.  
  195. direct output to a log file rather than standard error.  This really just
  196. gets passed to $error
  197. can be set with "-log file" on the command line
  198. (value required if set )
  199.  
  200. set debuglev = 1
  201.  
  202. default debug level, passed to $error
  203.  0 -> only fatal error messages
  204.  1 -> lets you know what is going on
  205.  3 -> possably interesting stuff
  206.  4 ( or higher ) -> very verbose
  207. can be overridden with "-debug n" on the command line
  208. (value required if set )
  209.  
  210. #set quiet
  211.  
  212. make "-q" on by default ( overwrites files without asking )
  213. this cannot be overriden on the command line
  214.  
  215. more usage notes are in the shell script 'ps2eps-mac'
  216.  
  217. this shell archive contains
  218. makefile            -- enter 'make' to compile..
  219. ps2eps-mac          -- executable shell script
  220. ps-pict2macbin.c    -- source for macbinary creating utility
  221. test.ps             -- simple test file
  222. test-ex.eps.bin.uu  -- example macbinary, created from test.ps
  223. README              -- this file
  224. er_echo.c           -- error handling c program
  225. pbmtoepsi.c         -- additional pbmplus source
  226. ps2eps-mac.1        -- unix man page 
  227.  
  228. version history
  229. initial release 4/4/92
  230. george jefferson  george@mech.seas.upenn.edu
  231. v.0.1 4/5/92
  232. added options to modify line ending translation in ps2eps-mac script
  233. ( same action by default )
  234. v.0.2 4/5/92
  235. added code to widen the bounding box -- by 1 pt as default
  236. better test.ps
  237. v.0.3 4/6/92 
  238. corrections to documentation
  239. change default file type to EPSF
  240. fixed info header bug
  241. pad resource fork to 128 byte bound ( suntar choked... )
  242. v.0.4
  243. now looks for a bounding box line in the source file and uses it
  244. rather than using ppmtoepsi to calculate..
  245. this feature is 'on' by default  ( see bbinfo option )
  246. explination of most options moved to this file from the shell script
  247. v.0.5
  248. I _think_ the bounding box is now calculated correctly in all cases.
  249. v.0.6
  250. added er_echo.c, which lets me do nice error reporting
  251. ( if er_echo fails to work, it is a bit superfluous, unset $error )
  252. v.0.7
  253. bypass ftime, for sysv machines
  254. v.0.8
  255. more sysv compatabilty modification
  256. shortened ps-pict2macbin.c to ps-pict2macb.c
  257. v.0.9
  258. added pbmtoepsi source to distribution
  259. v.0.91
  260. fixed time() bug which caused crash on sun3's
  261. v.1.0
  262. included st_echo, although i dont know of any problems with er_echo
  263. added man page, now i think we are ready to send to some ftp sites.
  264. v.1.1 
  265. recognises gs2.4 multi-page output, aborts with an apropriate message.
  266. v.1.2
  267. compatability with several different BoundingBox formats
  268. ( atend )
  269. non - integer values
  270. box:x ( no space )
  271. makes sure first line is %!PS-Adobe
  272. even more saninty checking.
  273. repaired major bug in ps-pict2macb.c, which caused mac to crash 
  274.  with large images.
  275. more output options
  276. v.1.3
  277. color support.
  278. fixed ftp output
  279.